import React from 'react';
import { history } from 'umi'
import { Tooltip } from 'antd';
import BizIcon from '@/components/BizIcon';
import AuthComponent from '@/utils/auth/AuthComponent';

// import useRelaunch from '@/pages/Recruitment/Hire/hooks/useRelaunch';

const ReStartApprovalLink = ({ title = '重新发起录用审批', type = 'qudaofabu', params = {} }) => {
    const { candidateId, employId } = params;
    const handleJump = React.useCallback(() => {
        history.push({
            pathname: '/office/personnelManagement/recruitment/hire/communicate',
            query: { action: 'edit', candidateId, employId, type: 'hr' }
        });
    }, [candidateId, employId]);
    return (
        <AuthComponent code="office:recruitment:course:hire:detail:relaunch">
            <Tooltip title={title}>
                <BizIcon
                    type={type}
                    style={{ cursor: 'pointer' }}
                    onClick={() => {
                        handleJump();
                    }}
                />
            </Tooltip>
        </AuthComponent>
    );
};

export default ReStartApprovalLink;
